Electronic control system

ABSTRACT

An engine control system stores data indicating a monitor frequency ratio for each failure diagnosis target item in EEPROM and standby RAM being backed up by a battery. The failure diagnosis target items are designated based on Rate Base Monitor Method. A data item of the data indicating a monitor frequency is incremented by one, at one time at the maximum, for one operation period of the system. When the system starts its operation, whether a value S [i] in standby RAM is greater by one than a value E [i] in EEPROM is determined for each data item. When the determination is affirmed for a given data item, it is determined that storing of the given data item is not completed in EEPROM for the preceding operation period. The value S [i] is thereby written in EEPROM.

CROSS REFERENCE TO RELATED APPLICATIONS

[0001] This application is based on and incorporates herein by referenceJapanese Patent Applications No. 2002-311390 filed on Oct. 25, 2002 andNo. 2003-307331 filed on Aug. 29, 2003.

FIELD OF THE INVENTION

[0002] The present invention relates to an electronic control systemthat continuously stores specific data that is updated for an operationperiod by using an electrically erasable non-volatile memory. Inparticular, it relates to technology for detecting that storing data inthe non-volatile memory is missed.

BACKGROUND OF THE INVENTION

[0003] Information such as failure diagnosis information or learnedcontrol values needs to be stored in an electronic control system for anautomobile even while no operating electric power is supplied to theelectronic control system. The information is therefore conventionallystored in a non-volatile memory such as EEPROM where data iselectrically erasable. The information can be thereby continuouslystored even when a backup battery runs out or is being disconnected. Forinstance, data in a given area of backup RAM being backed up by abattery is seriatim stored in EEPROM. When the data in the backup RAM isdetermined to be abnormal at starting timing of an operation period justafter tuning on of operating electric power, the corresponding data inthe EEPROM is written in the given area in the backup RAM. (Refer toPatent 1: JP-A-H4-336351.)

[0004] In this kind of the electronic control system, normality of thedata stored in EEPROM is checked by using checksum. (Refer to Patent 2:JP-A-H5-216776.) Furthermore, there are other checking methods asfollows: (1) Mirror data method and (2) Majority vote method. In Mirrordata method, target data is stored in EEPROM along with mirror data.Here, the sum of an original value of the target data and the mirrordata is designed as being a given value. When the sum of the target dataand the mirror data does not become the given value, abnormality isdetermined. In Majority vote method, the target data is redundantlystored in three areas in EEPROM. The correct original value isdetermined by a majority vote among the three.

[0005] Meanwhile, an electronic control system for an automobile needsto continuously store a monitor frequency ratio according to Rate BaseMonitor Method of OBD II (On Board Diagnostic II) by CARB (CaliforniaAir Resources Board). The monitor frequency ratio is defined with thefollowing formula:

Monitor frequency ratio=monitoring execution frequency/operationfrequency

[0006] Here, the monitor frequency ratio is a frequency ratio of afailure diagnosis being executed on a given item and exists for eachitem such as a catalyst converter, a fuel evaporation system, an O₂sensor, and the like. The operation frequency (hereinafter, referred toas denominator) is data that is incremented when a given travelingcondition specified by legislation is effected for the given item. Themonitoring execution frequency (hereinafter, referred to as numerator)is data that is incremented when it is determined that normality oranomaly is present after a condition of failure diagnosis executionspecified by an automotive manufacturer is effected for the given item.Each of the numerator and the denominator is incremented by one orremains without being incremented, for an operation period. Theoperation period is from turning on to turning off of an ignition switchof the vehicle, or from turning on to turning off of operating electricpower to an electronic control system executing a failure diagnosis.Therefore, once a numerator or denominator for the given item isincremented for a given operation period, the numerator or denominatoris no more updated for the given operation period.

[0007] In the above checking methods, whether data in EEPROM is brokenor not can be checked. However, whether rewriting data in thenon-volatile memory such as EEPROM is completed or not for the precedingoperation period of the electronic control system cannot be checked. Inother words, failure to properly store data, or missing of storing data(hereinafter, also referred to as mis-storing of data) in EEPROM for thepreceding operation period cannot be checked.

[0008] Namely, even when the mis-storing of data takes place, checksumor mirror data remains normal in relationship with the data that wasunable to be rewritten. In Majority vote method, the same data is storedin three areas of the memory. The data is checked for each bit order inthe three areas, so that the same bit appearing in more than one area isrecognized as a correct bit in each bit order. Here, the mis-storing ofdata cannot be checked, either.

[0009] In particular, reading/writing data in EEPROM is executed througha serial communications line with a micro-computer, so that processingtime for the reading/writing data needs to be more than that in RAMbeing built in the micro-computer. Therefore, there is a probabilitythat the operating electric power to the electronic control system isturned off before the rewriting data in EEPROM is completed.

SUMMARY OF THE INVENTION

[0010] It is an object of the present invention to provide an electroniccontrol system being capable of detecting mis-storing of data in anon-volatile memory such as EEPROM. Here, the data is continuous storingtarget data that needs to be continuously stored even while operatingelectric power is turned off. The data has a value that advances to achange direction with having regularity such as a numerator anddenominator in Rate Base Monitor Method.

[0011] To achieve the above object, an electronic control system storingcontinuous storing target data in its electrically erasable non-volatilememory and a standby RAM being constantly supplied with data-storingelectric power is providing with the following. When a given operationperiod is started, a determination of whether a value of the continuousstoring target data in the standby RAM advances to a change directionfurther than a value of the continuous storing target data in thenon-volatile memory. When the determination is affirmed, it is detectedthat storing of the continuous storing target data in the non-volatilememory is not completed for a former operation period preceding to thegiven operation period.

[0012] Here, explanation will be added in a case that a value Da of thecontinuous storing target data in the standby RAM advances to the changedirection further than a value Db of the continuous storing target datain the non-volatile memory. In this case, when the given regularity isto simply increase, “Da>Db.” By contrast, when the given regularity isto simply decrease, “Da<Db.”

[0013] The above structure of the electronic control system enablesmis-storing of data in a non-volatile memory to be detected. This cannotbe realized by a checking method using checksum, mirror data, ormajority vote. Namely, it is supposed that, although storing updatedcontinuous storing target data in a standby RAM is completed, storingthe updated continuous storing target data in a non-volatile memory isnot completed due to turning off of operating electric power to theelectronic control system. Here, a value of the continuous storingtarget data in the standby RAM advances to the change direction furtherthan a value of the continuous storing target data in the non-volatilememory. This is thereby detected at starting timing of the subsequentoperation period, so that the mis-storing of the data in thenon-volatile memory can be detected.

[0014] In another aspect of the present invention, an electronic controlsystem having an electrically erasable non-volatile memory and a standbyRAM that is constantly supplied with data-storing electric power can bedifferently provided with the following. It is detected that a vehicleenters a given operating state. A failure diagnosis is executed on anin-vehicle device when a given condition is effected. A standby RAMstores an operation frequency and a failure diagnosis frequency. For anoperation period, the operation frequency stored in the standby RAM isrewritten as being incremented by one when it is detected that thevehicle enters the given operating state. The failure diagnosisfrequency stored in the standby RAM is rewritten as being incremented byone when the failure diagnosis is executed. After either the operationfrequency or the failure diagnosis frequency is rewritten, the rewrittenfrequency is stored in the non-volatile memory. When a given operationperiod is started, a determination of whether the operation frequency orthe failure diagnosis frequency in the standby RAM has a value greaterby one than a value in the non-volatile memory. When the determinationis affirmed, it is detected that storing of the operation frequency orthe failure diagnosis frequency in the non-volatile memory is notcompleted for a former operation period preceding to the given operationperiod.

[0015] This structure enables the mis-storing of the operation frequencyor failure diagnosis frequency in the non-volatile memory to bedetected.

BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and other objects, features, and advantages of thepresent invention will become more apparent from the following detaileddescription made with reference to the accompanying drawings. In thedrawings:

[0017]FIG. 1 is a block diagram showing structure of an electroniccontrol system according to an embodiment of the present invention;

[0018]FIG. 2A is a diagram explaining continuous storing target data;

[0019]FIG. 2B is a diagram explaining an increment end flag;

[0020]FIG. 3 is a flowchart diagram showing processing of incrementingcontinuous storing target data in RAM by a micro-computer of anelectronic control system;

[0021]FIG. 4 is a flowchart diagram showing periodic processing by amicro-computer of an electronic control system;

[0022]FIG. 5 is a flowchart diagram showing initialization processing bya micro-computer of an electronic control system;

[0023]FIG. 6 is a diagram explaining another regularity of continuousstoring target data; and

[0024]FIG. 7 is a flowchart diagram showing initialization processingbased on the regularity shown in FIG. 6.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0025] An electronic control system as an embodiment of the presentinvention will be explained regarding its structure with reference toFIG. 1. FIG. 1 shows a block diagram of structure of the electroniccontrol system (hereinafter referred to as ECU) mounted in a vehicle forcontrolling an engine of an internal combustion type.

[0026] As shown in FIG. 1, an ECU 1 is equipped with an input processingcircuit 5, a micro-computer 7, an EEPROM 11 as a rewritable non-volatilememory, an output circuit 15, and a power circuit 21. The inputprocessing circuit 5 receives signals from various sensors 3 fordetecting an engine state or states of peripheral devices of the engineto execute waveform processing. The micro-computer 7 executes variousprocessing relating to an engine control, a failure diagnosis, and thelike based on the signals from the sensors 3 through the inputprocessing circuit 5. The EEPROM 11 is connected with the micro-computer7 via a communications line 9 to store continuous storing target data.The continuous storing target data is included in data computed by themicro-computer 7 and needs to be continuously stored even afteroperating electric power for the ECU 1 is turned off. The output circuit15 activates actuators 13 of a fuel injecting system (injector), anignition system (igniter), or the like, being provided in the engine,based on a control signal from the micro-computer 7. The power circuit21 receives, as an operating electric power, voltage VD supplied from abattery 19 based on turning on of an ignition switch 17. It thensupplies the respective components, including the micro-computer 7within the ECU 1, with power voltage Vm (e.g., 5 V) for operating. Itfurthermore generates to output auxiliary power voltage Vs(corresponding to data-storing electric power) for a standby RAM 29within the micro-computer 7 to continuously store data.

[0027] The power circuit 21 also has a function of a so-called power-onreset. Namely the power circuit 21 continues to output a reset signal tothe micro-computer 7 till the above power voltage Vm becomes stableafter the ignition switch 17 is turned on to start supplying the powervoltage Vm.

[0028] The micro-computer 7 is equipped with a known CPU 23, anon-volatile ROM 25, a volatile RAM 27, a standby RAM 29, and aninput/output (I/O) 31. The non-volatile ROM 25 stores an executableprogram executed by the CPU 23. In detail, the executable programincludes command codes constituting the executable program and fixedcodes referred to when the executable program is executed. The volatileRAM 27 temporarily stores computation results or the like from the CPU23. The standby RAM (hereinafter referred to as SRAM) 29 is backed up bya battery to be able to continuously store data by being supplied withthe auxiliary power voltage Vs from the power circuit 21. The I/O 31exchanges signals or data with the input processing circuit 5, theEEPROM 11, the output circuit 15, or the like. Here, the RAM 27 beingnot backed up by the battery is differentiated from the SRAM 29 by beingreferred to as NRAM (Normal RAM) 27.

[0029] The ECU 1 having the above components operates by receiving thepower voltage VD from the battery 19 while the ignition switch 17 isturned on. As the ignition switch 17 is turned on and then a resetsignal to the micro-computer 7 is released, the micro-computer 7 in theECU 1 starts operation from an initial state to execute initializationprocessing and then controlling processing for controlling the engine.Here, the operation of the micro-computer 7 is done by that the CPU 23executes the program included in the ROM 25.

[0030] The micro-computer 7 executes, e.g., periodically, adetermination of whether an execution condition for a failure diagnosisis effected for each failure diagnosis target item such as the catalystconverter, the fuel evaporation system, the O₂ sensor, and the likespecified in Rate Base Monitor Method of OBD II by CARB. When theexecution condition is effected, the micro-computer 7 executes a failurediagnosis on the corresponding failure diagnosis target item todetermine normality or anomaly. Furthermore, the micro-computer 7continuously stores and updates the numerator (monitoring executionfrequency as failure diagnosis frequency) and denominator (operationfrequency) of the monitor frequency ratio by using the EEPROM 11 andSRAM 29.

[0031] Furthermore, the ECU 1 is connectable with a diagnosing tool 33outside the vehicle via a diagnosis connector 35. The ECU 1 is designedas outputting corresponding data based on a request for outputtinginformation relating to the failure diagnosis from the diagnosing tool33. When outputting information relating to the above failure diagnosismonitor frequency ratio is requested, data of the numerator anddenominator stored in the EEPROM 11 is outputted to the diagnosis tool33. Here, the outputting processing is executed by the micro-computer 7.A communications circuit 37 shown in FIG. 1 is used for themicro-computer 7 to communicate with the diagnosing tool 33.

[0032] In the next place, processing executed by the micro-computer 7 inthe ECU 1 will be explained regarding continuously storing and updatingthe numerator and denominator of the monitor frequency ratio for eachfailure diagnosis target item with reference to FIGS. 2A, 2B, 3 to 5.

[0033] As shown in FIG. 2A, the continuous storing target data (CSTDATA) includes, in its blocks, a numerator (NUM) and a denominator (DEN)of a monitor frequency ratio for each of the failure diagnosis targetitems with assigning block numbers from zero. For instance, the zerothand first blocks include data items for a numerator and a denominator ofa failure diagnosis frequency ratio of a fuel evaporation system(EVAPO), respectively. The second and third blocks include data itemsfor a numerator and a denominator of a failure diagnosis frequency ratioof a catalyst converter (CATAL), respectively. The fourth and fifthblocks include data items for a numerator and a denominator of a failurediagnosis frequency ratio of an 02 sensor (SENSOR), respectively.

[0034] Furthermore, as shown in FIG. 2B, in the NRAM 27, an incrementend flag is included with having each increment end flag item F [i]. Theincrement end flag item F [i] indicates whether the corresponding dataitem in the block [i] in the continuous storing target data isincremented. Here, i is any one from zero to (n−1) when the total numberof the blocks of the continuous storing target data is n.

[0035] The micro-computer 7, as shown in FIG. 3, when a condition forincrementing each data item is effected (Step 91: YES), the data item isincremented (Step 93) and the corresponding increment end flag item F[i] is tuned ON (Step 95).

[0036] Here, as previously explained, it is determined that a conditionof incrementing each denominator is effected by the following steps: Atraveling condition specified by the legislation for the correspondingfailure diagnosis target item is effected, or it is effected when thevehicle enters a given operating state specified by the legislation forthe corresponding failure diagnosis target item; And, that the travelingcondition is effected is detected by detecting processing.

[0037] By contrast, it is determined that a condition of incrementingeach numerator is effected by the following steps: A condition forfailure diagnosis execution specified by the automotive manufacturer isdetermined to be effected for the corresponding failure diagnosis targetitem; And, the failure diagnosis is executed; The determination ofnormality or anomaly is completed. Here, each increment end flag item F[i] is previously cleared to OFF by initialization in the NRAM 27 (Step205 in FIG. 5, to be explained). The initialization in the NRAM 27 isexecuted when the micro-computer 7 initializes at start of itsoperation.

[0038] Referring to FIG. 4, periodic processing is executed by themicro-computer 7 for given time intervals (e.g., every 64 ms). At Step110, at first, Variation i is set to zero. Here, Variation i indicatesthe number of a block of the continuous storing target data and isstored in the NRAM 27. At Step 120, it is determined whether Variation iis less than the total number n of data items (or blocks) of thecontinuous storing target data.

[0039] When Variation i is determined to be less than n (Step 120: YES),the processing proceeds to Step 130. Here, it is determined whetherincrementing a data item of the continuous storing target data in theblock [i] is completed by detecting whether the corresponding incrementend flag item F [i] is set to ON. When the incrementing is determined tobe not completed, the processing proceeds to Step 140, where Variation iis incremented by one. The processing then returns to Step 120.

[0040] By contrast, when the incrementing is determined to be completed,the processing proceeds to Step 150. Here, the corresponding data itemof the continuous storing target data in the block [i] in the NRAM 27 isstored in the SRAM 29. A value of the data item of the correspondingcontinuous storing target data in the SRAM 29 is thereby rewritten asbeing incremented by one time. Namely, when a condition for incrementingany data item of the continuous storing target data is effected, astored value in the SRAM 29 is rewritten as being incremented by onetime at Step 150.

[0041] Then, at Step 160, the corresponding data item of the continuousstoring target data in the block [i] in the NRAM 27 is also stored inthe EEPROM 11. The value in the SRAM 29 updated at Step 150 is alsostored in the EEPROM 11. Thereafter, the processing proceeds to Step140, where Variation i is incremented by one. The processing returns toStep 120.

[0042] Meanwhile, when Variation i is determined to be not less than n(Step 120: NO), the processing is terminated. Consequently, in theperiodic processing in FIG. 4, in the processing at Steps 110 to 140,the increment end flag items F [i] corresponding to all the data itemsof the continuous storing target data are checked, so that any data itemof the continuous storing target data that is incremented for thepresent operation period of the ECU 1 can be searched for. When there isa data item that is incremented for the present operation (Step 130:YES), the value of the data item in the NRAM 27 is written in both theSRAM 29 and the EEPROM 11 (Step 150, 160).

[0043] To save a frequency of data writing in the EEPROM 11, it can bedesigned that the data item that is previously written in the EEPROM 11at Step 160 does not any more undergo the processing at Step 160.

[0044] In detail, a writing completion flag for each data item of thecontinuous storing target data can be provided in the NRAM 27. Thewriting completion flag is initialized to an OFF state by theinitialization processing to the NRAM 27, along with the increment engflag. At Step 160, a corresponding writing completion flag for the dataitem of the continuous storing target data that is written in the EEPROM11 is switched to an ON state. At Step 130, even when it is determinedthat incrementing the data item of the continuous storing target data inthe block [i] is completed, the processing directly returns to Step 140with passing through the subsequent processing at Steps 150, 160 whenthe writing completion flag is already in the ON state.

[0045] The initialization processing will be explained with reference toFIG. 5. The initialization processing is executed by the micro-computer7 at the start of the operation due to turning on of the ignition switch17. As the micro-computer 7 starts the initialization processing, atfirst data in the NRAM 27 is initialized at Step 205. Then at Step 210,it is determined whether data in the SRAM 29 is normal. Here, the datain the SRAM 29 is determined to be normal by determining that there isno history that the battery 19 is disconnected in addition todetermining that data is normal through checking of its checksum orparity.

[0046] When the data in the SRAM 29 is determined to be normal (Step210: YES), the processing proceeds to Step 220. Here, Variation iindicating the number of a block of the continuous storing target datais set to zero. At Step 230, it is determined whether Variation i isless than the total number n of the data items of the continuous storingtarget data.

[0047] When Variation i is determined to be less than the total number n(Step 230: YES), the processing proceeds to Step 240. Here, it isdetermined whether a value S [i] in the SRAM 29 is equal to a value E[i], in the EEPROM 11, plus one. Here, the value S [i] or value E [i] isa value of the i-th data item of the continuous storing target data inthe SRAM 29 or the EEPROM 11, respectively. When it is determined to benot equal, the processing proceeds to Step 250, where Variation i isincremented by one. The processing then returns to Step 230.

[0048] When it is determined to be equal, i.e., S [i]=E [i]+1 (Step 240:YES), it is determined that rewriting the i-th data item of thecontinuous storing target data in the EEPROM 11 is not completed. Inother words, storing of the i-th data item in the EEPROM 11 is missed.The processing proceeds to Step 260, where the value S [i] is written inthe EEPROM 11 as substituting for the value E [i]. Thereafter, theprocessing proceeds to Step 250, where Variation i is incremented byone. The processing then returns to Step 230.

[0049] On the other hands, when it is determined that Variation i is notless than the total number n, i.e., i≧n (Step 230: YES), the processingproceeds Step 280, where all the data items of the continuous storingtarget data in the SRAM 29 are copied in the NRAM 27. Hereafter, theprocessing proceeds to engine controlling processing, the periodicprocessing shown in FIG. 4, or the like.

[0050] Further, when it is determined that the data in the SRAM 29 isdetermined to be not normal (Step 210: NO), the processing proceeds toStep 270, where all data items of the continuous storing target data inthe EEPROM 11 are copied in the SRAM 29. The processing then proceeds toStep 280, where the above-explained processing takes place.

[0051] Consequently, in the initialization processing, when the data inthe SRAM 29 is normal (Step 210: YES) and storing data in the precedingoperation period is missed in the EEPROM 11 (Step 240: YES), the data inthe SRAM 29 is copied in the EEPROM 11 (Step 260).

[0052] Furthermore, when the data in the SRAM 29 is normal (Step 210:YES), the final values of the continuous storing target data in thepreceding operation period are correctly stored in the SRAM 29 (Step 150in FIG. 4). The values of the data in the SRAM 29 that correctly takeover the values in the preceding operation period are thereby copied inthe NRAM 27 (Step 280) to be updated in the present operation period.

[0053] When the data in the SRAM 29 is not normal (Step 210: NO), thevalues of the data in the EEPROM 11 are copied in the SRAM 29 (Step270). It is because the final values of the continuous storing targetdata in the preceding operation period are assumed to be more correctlystored in the EEPROM 11 (Step 160 in FIG. 4) in comparison with the SRAM29 whose data is determined to be not normal.

[0054] As explained above, according to the ECU 1 of the embodiment,mis-storing of the data in the EEPROM 11 is correctly detected regardingthe data that is incremented by one at one time for one operationperiod. The data in the EEPROM 11 that is missed being stored isfurthermore recovered by writing in the EEPROM 11 the data stored in theSRAM 29. For instance, the above-described data includes continuousstoring target data that indicates a monitor frequency ratio of eachdiagnosis target item specified by Rate Base Monitor Method.

[0055] Furthermore, in the ECU 1 of the embodiment, when the ECU 1starts the initialization processing along with turning on of theoperating electric power VD, it is determined whether the data in theSRAM 29 is normal (Step 210). When the data in the SRAM 29 is determinedto be not normal, the processing at Steps 220 to 260 is prohibited fromtaking place (Step 210: NO).

[0056] Otherwise, although the data in the SRAM 29 becomes abnormal,e.g., due to being disconnected of the battery 19, the abnormal data inthe SRAM 29 may be mistakenly written in the EEPROM 11 and the correctdata in the EEPROM 11 may be misrecognized as abnormal data.

[0057] (Modification)

[0058] Although one embodiment of the present invention is explainedabove, the present invention can be also directed to other embodiments.

[0059] In the above embodiment, continuous storing target data undergoesincreasing change as being incremented by one at one time for oneoperation period of the ECU 1. At Step 240 in FIG. 5, it is therebydetermined whether “S [i]=E [i]+1” is affirmative. However, when thedata undergoes decreasing change, it can be determined whether “S [i]=E[i]−1” is affirmative.

[0060] Furthermore, when the data may undergo increasing change as beingincremented by a given value at a plurality of times for one operationperiod, it can be determined whether “S [i]>E [i]” is affirmative. Bycontrast, when the data may undergo decreasing change as beingincremented by a given value at a plurality of times for one operationperiod, it can be determined whether “S [i]<E [i]” is affirmative. Here,the given value can be variable instead of being constant.

[0061] In the above embodiment, writing the continuous storing targetdata in the SRAM 29 and the EEPROM 11 is executed in one periodicprocessing shown in FIG. 4. However, the writing can be executed everyroutine where each data item of the continuous storing target data isupdated in the NRAM 27 with using a functional call, a subroutine form,or the like.

[0062] In the above embodiment, the NRAM 27 can be not provided. In thiscase, the SRAM 29 can be also used for data processing includingprocessing of incrementing the continuous storing target data, so thatprocessing at Step 150 in FIG. 4 and Steps 205, 280 in FIG. 5 iseliminated. The increment end flag item F [i] is thereby stored in theSRAM 29, so that initializing the flag can be included in theinitialization processing.

[0063] In FIG. 5, processing at Step 270 can be executed just before theprocessing at Step 280 when either of the determinations at Step 210,230 is negated. However, it is effective to execute the processing atStep 270 only when the data is determined to be not normal at Step 210.

[0064] The EEPROM 11 as a non-volatile memory being electricallyerasable can be replaced with a flush ROM.

[0065] The continuous storing target data can be also not data thatundergoes one-directional change of one of increasing and decreasing. Itcan be data that repeats increase and decrease from an initial value Ato a final value B. In this case, mis-storing of the data can bedetected based on regularity where the final value B eventually reachesthe initial value A, and recovering the data can be then executed. Indetail, as shown in FIG. 6, certain continuous storing target data has acharacteristic where a value of the data is updated as being incrementedone by one from an initial value of zero to a final value of fifteen andthen as returning to the initial value of zero after reaching the finalvalue. In this case, the initialization processing shown in FIG. 5 canbe modified to that in FIG. 7. Processing at Steps in FIG. 7 having thesame step number in FIG. 5 is the same as in FIG. 5, so that explanationof the processing at the same step numbers will be eliminated.

[0066] Namely, in the initialization processing, Step 245 is added toprocessing in FIG. 5. When it is determined that “S [i]=E [i]+1” isnegated at Step 240, it is determined whether “S [i]=0 and E [i]=15” isaffirmed at Step 245. When it is determined that “S [i]=0 and E [i]=15”is negated, the processing proceeds to Step 250. When it is determinedthat “S [i]=0 and E [i]=15” is affirmed, mis-storing in the i-th dataitem in the EEPROM 11 is determined to be taking place in the precedingoperation period. The processing thereby proceeds to Step 260, where avalue S [i] in the SRAM 29 can be copied in a value E [i] in the EEPROM11.

[0067] In the above processing, even when the continuous storing targetdata is a kind of the above certain continuous storing target datahaving the regularity shown in FIG. 6, the mis-storing of the data inthe EEPROM 11 can be detected. Furthermore, data can have differentregularity where data is updated as being decremented one by one from aninitial value of the maximum value to a final value of the minimum valueand then as returning to the initial value of the maximum value afterreaching the final value.

[0068] Furthermore, in the above embodiments, continuous storing targetdata is incremented by only one at one time, but it can be alsoincremented by any value instead of one, for instance, a certainintegral number such as two, three, ten, or the like.

[0069] It will be obvious to those skilled in the art that variouschanges may be made in the above-described embodiments of the presentinvention. However, the scope of the present invention should bedetermined by the following claims.

What is claimed is:
 1. An electronic control system that enters anoperation period from turning on of operating electric power to turningoff of the operating electric power and makes both a non-volatile memoryand a standby RAM execute storing of continuous storing target data,wherein in the non-volatile memory data is electrically erasable,wherein the standby RAM is a memory and is continuously supplied withdata-storing electric power for continuously storing data, and whereinthe continuous storing target data needs to be continuously stored evenwhile the operating electric power is turned off and has a value that isupdated as advancing to a given change direction with at least one ofincreasing and decreasing based on given regularity, the electroniccontrol system comprising: determining means for executing, when a givenoperation period is started due to turning on of the operating electricpower, a determination of whether a value of the continuous storingtarget data in the standby RAM advances to the given change directionfurther than a value of the continuous storing target data in thenon-volatile memory; and detecting means for detecting, when thedetermination executed by the determining means is affirmed, thatstoring of the continuous storing target data in the non-volatile memoryis not completed for a former operation period preceding to the givenoperation period.
 2. The electronic control system according to claim 1,wherein the continuous storing target data has a value that is updated,at most one time, for an operation period from turning on of theoperating electric power to turning off of the operating electric power,as advancing to the given change direction by a given integral number,wherein the determining means executes, when the given operation periodis started due to turning on of the operating electric power, a givendetermination of whether a value of the continuous storing target datain the standby RAM advances to the given change direction by the givenintegral number than a value of the continuous storing target data inthe non-volatile memory, and wherein the detecting means detects, whenthe given determination is affirmed, that storing of the continuousstoring target data in the non-volatile memory is not completed for theformer operation period preceding to the given operation period.
 3. Theelectronic control system according to claim 1, further comprising:recovering means for writing in the non-volatile memory the value of thecontinuous storing target data in the standby RAM when the detectingmeans detects that storing of the continuous storing target data in thenon-volatile memory is not completed for the former operation period. 4.The electronic control system according to claim 1, further comprising:prohibiting means for executing, when the given operation period isstarted, a certain determination of whether the continuous storingtarget data in the standby RAM is normal, and for prohibiting, when thecertain determination is negated, the detecting means from detectingthat storing of the continuous storing target data in the non-volatilememory is not completed for the former operation period even when thegiven determination is affirmed.
 5. An electronic control system thatenters an operation period from turning on of operating electric powerto turning off of the operating electric power and controls anin-vehicle device in a vehicle, the electronic control systemcomprising: state detecting means for detecting that the vehicle entersa given operating state; failure diagnosing means for executing afailure diagnosis on the in-vehicle device when a given condition iseffected; a non-volatile memory where stored data is electricallyerasable; a standby RAM that is continuously supplied with data-storingelectric power for continuously storing data and stores frequencyinformation including an operation frequency and a failure diagnosisfrequency; rewriting means for rewriting the frequency information inthe standby RAM for the operation period, wherein the operationfrequency of the frequency information is rewritten as being incrementedby one when the state detecting means detects that the vehicle entersthe given operating state while the failure diagnosis frequency of thefrequency information is rewritten as being incremented by one when thefailure diagnosing means executes the failure diagnosis; storing meansfor storing, after the rewriting means rewrites the frequencyinformation, the rewritten frequency information in the non-volatilememory; determining means for executing, when a given operation periodis started due to turning on of the operating electric power, adetermination of whether at least one frequency of the operationfrequency and the failure diagnosis frequency in the standby RAM has avalue greater by one than a value of the one frequency of the operationfrequency and the failure diagnosis frequency in the non-volatilememory; and mis-storing detecting means for detecting, when thedetermination executed by the determining means is affirmed, thatstoring of the one frequency of the operation frequency and the failurediagnosis frequency in the non-volatile memory is not completed for aformer operation period preceding to the given operation period.
 6. Theelectronic control system according to claim 5, further comprising:outputting means that is connectable with a diagnosing tool outside ofthe vehicle and is for outputting to the diagnosing tool the frequencyinformation stored in the non-volatile memory when outputting of thefrequency information is requested from the diagnosing tool.